Skip to content

feat: update lifecycle logic to handle - after prefix - #188

Open
Larry1123 wants to merge 1 commit into
keithamus:mainfrom
Larry1123:Larry1123-feat-extra-prefix
Open

feat: update lifecycle logic to handle - after prefix#188
Larry1123 wants to merge 1 commit into
keithamus:mainfrom
Larry1123:Larry1123-feat-extra-prefix

Conversation

@Larry1123

Copy link
Copy Markdown

I don't think that this should affect any. I am working on a plugin for yarn 2 to add lifecycle handing.
As they say in their docs using just pre and post can have odd side effects. The plugin I am creating will use pre- and post- as the prefix. I use this package and wanted to keep using it without patching it per project to make use of it.

From yarn docs.
In particular, we intentionally don't support arbitrary pre and post hooks for user-defined scripts (such as prestart). This behavior, inherited from npm, caused scripts to be implicit rather than explicit, obfuscating the execution flow. It also led to surprising executions with yarn serve also running yarn preserve.

@Larry1123 Larry1123 changed the title update lifecycle logic to handle - after prefix feat: update lifecycle logic to handle - after prefix May 21, 2020
@Larry1123

Copy link
Copy Markdown
Author

I am unsure why eslint is failing it is not failing locally when I run it.

@fisker

fisker commented May 22, 2020

Copy link
Copy Markdown
Collaborator

Any docs suggest pre- instead of pre ?

@Larry1123

Copy link
Copy Markdown
Author

No I have not. I had looked over a lot of names that come up and I felt that even if it was used most uses causes like pre-commit would likely be fine with being sorted near and around other commands like it anyway.
I was looking for a way to add a new way to do lifecycle hooks that would not match other known ones, but a naming format that would still work even if someone was not needing it.
The main reason I went with using - was that it would avoid issues with words inadvertently matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants